<h2>User</h2>

<?php
echo $this->Form->create('Authuser', array('action' => 'index', 'class' => 'formsearch'));
echo $this->Form->input('textsearch', array('fieldset' => false, 'label' => 'Search', 'div' => false, 'class' => 'text ui-widget-content ui-corner-all', 'style' => 'width: 200px;float:left;'));
echo $this->Form->end(array('label' => __('Search', true), 'div' => false, 'class' => 'ui-button ui-widget ui-state-default ui-corner-all', 'style' => 'padding-top: 2px; padding-bottom: 3px; margin-left: 4px;'));
?>

<div style="clear:both;">
    <?php echo $this->Html->link(__('New User'), array('action' => 'add'), array('class' => 'ui-button ui-widget ui-state-default ui-corner-all', 'style' => 'padding-top: 2px; padding-bottom: 3px;')); ?>
</div>

<div class="autoscroll">
    <table cellpadding="0" cellspacing="0"  class="list issues" >
        <tr>
            <th><?php echo $this->Paginator->sort(__('name', true), 'Name'); ?></th>
            <th><?php echo $this->Paginator->sort(__('username', true), 'Username'); ?></th>
            <th><?php echo $this->Paginator->sort(__('usergroup_id', true), 'User Group'); ?></th>
            <th><?php echo $this->Paginator->sort(__('allow', true), 'Allow'); ?></th>
            <th class="actions">Actions</th>
        </tr>
        <?php foreach ($authusers as $authuser): ?>
            <tr>
                <td class="a-left"><?php echo $authuser['Authuser']['name']; ?></td>
                <td ><?php echo $authuser['Authuser']['username']; ?></td>
                <td><?php echo $this->Html->link($authuser['Authusergroup']['name'], array('controller' => 'authusergroups', 'action' => 'view', $authuser['Authusergroup']['id'])); ?></td>
                <td><?php echo(($authuser['Authuser']['allow']) ? "Yes" : "No"); ?></td>
                <td class="actions">
                    <?php echo $this->Html->link(__('View', true), array('action' => 'view', $authuser['Authuser']['id']), array('class' => 'icon icon-read')); ?> 
                    <?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $authuser['Authuser']['id']), array('class' => 'icon icon-edit')); ?>
                    <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $authuser['Authuser']['id']), array('class' => 'icon icon-delete'), sprintf(__('Are you sure you want to delete # %s?', true), $authuser['Authuser']['id'])); ?></td>
            </tr>
        <?php endforeach; ?>
    </table>
</div>

<div class="paging">
    <?php echo $this->Paginator->first($this->Html->image('first_off.png'), array('url' => array('textsearch' => $textsearch), 'escape' => false)); ?>
    <?php echo $this->Paginator->prev($this->Html->image('prev_off.png'), array('url' => array('textsearch' => $textsearch), 'escape' => false)); ?>
    <?php $pag_number = $this->Paginator->numbers(array('url' => array('textsearch' => $textsearch))); ?>
    <?php
    echo(!empty($pag_number)) ? '|' : '';
    echo $pag_number;
    ?>
    <?php echo $this->Paginator->next($this->Html->image('next_off.png'), array('url' => array('textsearch' => $textsearch), 'escape' => false)); ?>
    <?php echo $this->Paginator->last($this->Html->image('last_off.png'), array('url' => array('textsearch' => $textsearch), 'escape' => false)); ?>
</div>